import request from "./request";

/** 失物招领 */

//发布
export async function issueLost (param,params) {
  return await request({
    url: '/lost/insert',
    method: 'post',
    data:param,
    headers: {
      'Content-Type': 'application/json',
      'token': params.token 
    }
  })
}

//分页查询
export async function pageLost (param,params) {
  return await request({
    url: '/lost/page/'+param.current+'/'+param.size+'?itemsName='+param.itemsName+'&tag='+param.tag+'&issueTime='+param.issueTime,
    method: 'get',
    headers: {
      'Content-Type': 'application/json',
      'token': params.token 
    }
  })
}

//查询详情
export async function getDetails (param,params) {
  return await request({
    url: '/lost/visit/'+param.id+'/'+params.userId,
    method: 'get',
    headers: {
      'Content-Type': 'application/json',
      'token': params.token 
    }
  })
}

//查询历史
export async function pageHistory (param,params) {
  return await request({
    url: '/lost/history/'+params.userId+'/'+param.current+'/'+param.size,
    method: 'get',
    headers: {
      'Content-Type': 'application/json',
      'token': params.token 
    }
  })
}

//删除
export async function deleteLost (param,params) {
  return await request({
    url: '/lost/delete/'+param.id,
    method: 'delete',
    headers: {
      'Content-Type': 'application/json',
      'token': params.token 
    }
  })
}

